<html>
    <head>
        <script type="text/javascript" src="js/biginteger.js"></script>
        <script type="text/javascript" src="js/substandard_lisp.js"></script>
        <script type="text/javascript">
            var lisp = new interpreter();
            lisp.initialize();

            var sh = false;
            function t(v,e){
                switch(v.keyCode){
                    case(16):
                        sh = true;
                        break;
                    case(13):
                        if(!sh) break;
                        var input=e.value.replace('>','');
                        e.value='';
                        var o=document.getElementById('out');

                        var c=document.createElement("div");
                        c.innerHTML='> '+input+'<br>';

                        lisp.evaluate(input);

                        c.innerHTML += lisp.result;

                        o.appendChild(c);
                        break;
                }
            }
            function k(v,e){
                if(v.keyCode == 16){
                    sh = false;
                }
                if(e.value=='\n' || e.value=='') e.value='>';
            }
        </script>
    </head>
    <body>
        <div id="console" style="border:1px solid black;height:99%;width:99%;overflow-y:auto;">
            <div id="out"></div>
            <textarea id="in" type="text" style="width:100%;height:90px;border:none;display:float;" onkeydown="return t(event,this);" onkeyup="k(event,this);">></textarea>
        </div>
    </body>
</html>
